#!/bin/bash

# release on Kloxo-ST 7.0.0
# by mustafa.ramadhan@lxcenter.org

# ENVIRONMENT VARIABLE PRIMER FOR REFERENCE
# $0 script invoked
# $1, $2, $3 are the command line arguments
# $# Number of command line arguments 
# $@ all command line arguments - white space is preserved
# $* all command line arguments - white space striped 

if [ "$#" == 0 ] ; then
	echo
	echo " ------------------------------------------------------------------------------"
	echo "  format:"
	echo "    sh $0 --type=<> --key=<> [--client=<>]"
	echo " ------------------------------------------------------------------------------"
	echo
	echo " Formula: 'key IN type value' (example 'spf IN TXT \"v=spf1 a mx ~all\"')"
	echo
	echo " --client: is optional and able to '--client=client1,client2' for multiple clients"
	echo
	exit;
fi

request1=$1
REC_TYPE=${request1#--type\=}

request2=$2
REC_KEY=${request2#--key\=}

if [ "$REC_TYPE" == "" ] && [ "$REC_KEY" == "" ] ; then
	echo "Empty --type= --key= entry..."
	exit;
else
	if [ "$REC_TYPE" == "" ] ; then
		echo "Empty --type= entry..."
		exit;
	elif [ "$REC_KEY" == "" ] ; then
		echo "Empty --key= entry..."
		exit;
	fi
fi

. /script/directory
lxphp.exe ../bin/misc/fixdnsremoverecord.php $*